Micron Document
`:top
The `!OpenGL Utility Toolkit`! (`!GLUT`!) is a `F33f`_`[library`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Library_(computing)]`_`f of utilities for `F33f`_`[OpenGL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenGL]`_`f programs, which primarily perform system-level `F33f`_`[I/O`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Input/output]`_`f with the host `F33f`_`[operating system`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Operating_system]`_`f. Functions performed include window definition, window control, and monitoring of `F33f`_`[keyboard`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Computer_keyboard]`_`f and `F33f`_`[mouse`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Computer_mouse]`_`f input. Routines for drawing a number of geometric primitives (both in solid and wireframe mode) are also provided, including `F33f`_`[cubes`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cube_(geometry)]`_`f, `F33f`_`[spheres`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Sphere]`_`f and the `F33f`_`[Utah teapot`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Utah_teapot]`_`f. GLUT also has some limited support for creating pop-up menus.

GLUT was written by `F33f`_`[Mark J. Kilgard`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Mark_Kilgard]`_`f, author of `*OpenGL Programming for the X Window System`* and `*The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics`*, while he was working for `F33f`_`[Silicon Graphics`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Silicon_Graphics]`_`f Inc.

The two aims of GLUT are to allow the creation of rather portable code between operating systems (GLUT is `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f) and to make learning OpenGL easier. Getting started with OpenGL programming while using GLUT often takes only a few lines of code and does not require knowledge of operating system–specific windowing `F33f`_`[APIs`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Application_programming_interface]`_`f.

All GLUT functions start with the `B100`F9d9glut`f`b prefix (for example, `B100`F9d9glutPostRedisplay`f`b marks the current window as needing to be redrawn).

>>Contents

• `F0af`_`[Implementations`#implementations]`_`f
• `F0af`_`[Limitations`#limitations]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[External links`#external-links]`_`f

-─

>>Implementations

The original GLUT library by Mark Kilgard supports the `F33f`_`[X Window System`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=X_Window_System]`_`f (`F33f`_`[GLX`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GLX]`_`f) and was ported to `F33f`_`[Microsoft Windows`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Windows]`_`f (`F33f`_`[WGL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=WGL_(software)]`_`f) by Nate Robins. Additionally, `F33f`_`[macOS`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=MacOS]`_`f ships with a GLUT framework that supports its own NSGL/`F33f`_`[CGL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Core_OpenGL]`_`f.

Kilgard's GLUT library is no longer maintained, and its license did not permit the redistribution of modified versions of the library. This spurred the need for `F33f`_`[free software`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Free_software]`_`f or `F33f`_`[open source`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Open-source_software]`_`f reimplementations of the API from scratch. The first such library was `F33f`_`[FreeGLUT`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=FreeGLUT]`_`f, which aims to be a reasonably close reproduction, though introducing a small number of new functions to deal with GLUT's limitations. OpenGLUT, a `F33f`_`[fork`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Fork_(software)]`_`f of FreeGLUT, adds a number of new features to the original API, but work on it ceased in May 2005.

Mark Kilgard has a GitHub repository for GLUT.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f] The glut.h header file contains the following license:`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f]

`B100`F9d9/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998, 2000, 2006, 2010. */`f`b
`B100`F9d9`f`b
`B100`F9d9/* This program is freely distributable without licensing fees and is`f`b
`B100`F9d9 provided without guarantee or warrantee expressed or implied. This`f`b
`B100`F9d9 program is -not- in the public domain. */`f`b

>>Limitations

Some of GLUT's original design decisions made it hard for programmers to perform desired tasks. This led many to create non-canon patches and extensions to GLUT.[1] Some `F33f`_`[free software`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Free_software]`_`f or `F33f`_`[open source`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Open-source_software]`_`f reimplementations also include fixes.

Some of the more notable limitations of the original GLUT library include:

• The library requires programmers to call `B100`F9d9glutMainLoop()`f`b, a function which never returns. This makes it hard for programmers to integrate GLUT into a program or library which wishes to have control of its own event loop. A common patch to fix this is to introduce a new function, called `B100`F9d9glutCheckLoop()`f`b (macOS) or `B100`F9d9glutMainLoopEvent()`f`b (FreeGLUT/OpenGLUT), which runs only a single iteration of the GLUT event loop. Another common workaround is to run GLUT's event loop in a separate `F33f`_`[thread`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Thread_(computing)]`_`f, although this may vary by operating system, and also may introduce `F33f`_`[synchronization`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Synchronization_(computer_science)]`_`f issues or other problems: for example, the macOS GLUT implementation requires that `B100`F9d9glutMainLoop()`f`b be run in the main thread.
• The fact that `B100`F9d9glutMainLoop()`f`b never returns also means that a GLUT program cannot exit the event loop. `F33f`_`[FreeGLUT`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=FreeGLUT]`_`f fixes this by introducing a new function, `B100`F9d9glutLeaveMainLoop()`f`b.
• The library terminates the process when the window is closed; for some applications this may not be desired. Thus, many implementations include an extra callback, such as `B100`F9d9glutWMCloseFunc()`f`b.

Since it is no longer maintained (essentially replaced by the `F33f`_`[open source`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Open-source_software]`_`f `F33f`_`[FreeGLUT`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=FreeGLUT]`_`f) the above design issues are still not resolved in the original GLUT.

>>See also

• `F33f`_`[EGL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=EGL_(API)]`_`f is an interface between `F33f`_`[OpenGL ES`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenGL_ES]`_`f or `F33f`_`[OpenVG`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenVG]`_`f and a `F33f`_`[windowing system`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Windowing_system]`_`f.
• `F33f`_`[FreeGLUT`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=FreeGLUT]`_`f is intended to be a full replacement for GLUT, and has only a few differences.
• `F33f`_`[GLFW`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GLFW]`_`f
• `F33f`_`[Simple DirectMedia Layer`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Simple_DirectMedia_Layer]`_`f (SDL)
• `F33f`_`[OpenGL User Interface Library`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenGL_User_Interface_Library]`_`f (GLUI)
• `F33f`_`[OpenGL Utility Library`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenGL_Utility_Library]`_`f (GLU)

>>References

`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f "Glut". `*`F33f`_`[GitHub`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GitHub]`_`f`*. 21 November 2021. Archived from the original on 11 June 2018. Retrieved 13 October 2014.
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f "Glut". `*`F33f`_`[GitHub`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GitHub]`_`f`*. 21 November 2021. Archived from the original on 3 August 2022. Retrieved 13 October 2014.

>>External links

• GLUT - The OpenGL Utility Toolkit Archived 2018-01-18 at the `F33f`_`[Wayback Machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wayback_Machine]`_`f
• The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3 (official documentation)
• The OpenGL Utility Toolkit (GLUT) downloads (source and pre-compiled libraries)

`c`F0af`_`[↑ Back to top`#top]`_`f`a